package com.minimalist.common.entity.lindi.vo.tradeapplicationtemplatecontract;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.config.swagger.SchemaEnum;
import com.minimalist.common.entity.basic.enums.StatusEnum;
import com.minimalist.common.entity.basic.vo.file.FileVO;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 林地指标交易平台_交易申请合同模板实体
 *
 * @author 11987
 */
@Schema(name = "林地指标交易平台_交易申请合同模板实体")
public class LindiTradeApplicationTemplateContractVO implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;

    @NotNull(message = "交易申请合同模板ID不能为空", groups = {Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "tradeApplicationContractFileId", description = "交易申请合同模板ID", type = "string")
    private Long tradeApplicationContractFileId;

    @NotNull(message = "交易申请ID不能为空", groups = {Add.class, Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "tradeApplicationId", description = "交易申请ID", type = "string")
    private Long tradeApplicationId;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "fileId", description = "交易申请合同模板文件ID", type = "string")
    private Long fileId;

    @Schema(name = "file", description = "交易申请合同模板文件")
    private FileVO file;

    @Schema(name = "contractType", description = "合同类型", type = "string")
    private String contractType;

    @NotNull(message = "合同状态不能为空", groups = {Add.class, Update.class})
    @SchemaEnum(implementation = StatusEnum.class)
    @Schema(name = "status", description = "合同状态", type = "int")
    private Integer status;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "createId", description = "创建人ID", type = "string")
    private Long createId;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "updateId", description = "更新人ID", type = "string")
    private Long updateId;

    @Schema(name = "createTime", description = "创建时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime createTime;

    @Schema(name = "updateTime", description = "更新时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime updateTime;

    public Long getTradeApplicationContractFileId(){
        return tradeApplicationContractFileId;
    }

    public void setTradeApplicationContractFileId(Long tradeApplicationContractFileId){
        this.tradeApplicationContractFileId = tradeApplicationContractFileId;
    }

    public Long getTradeApplicationId(){
        return tradeApplicationId;
    }

    public void setTradeApplicationId(Long tradeApplicationId){
        this.tradeApplicationId = tradeApplicationId;
    }

    public Long getFileId(){
        return fileId;
    }

    public void setFileId(Long fileId){
        this.fileId = fileId;
    }

    public FileVO getFile(){
        return file;
    }

    public void setFile(FileVO file){
        this.file = file;
    }

    public String getContractType(){
        return contractType;
    }

    public void setContractType(String contractType){
        this.contractType = contractType;
    }

    public Integer getStatus(){
        return status;
    }

    public void setStatus(Integer status){
        this.status = status;
    }

    public Long getCreateId(){
        return createId;
    }

    public void setCreateId(Long createId){
        this.createId = createId;
    }

    public Long getUpdateId(){
        return updateId;
    }

    public void setUpdateId(Long updateId){
        this.updateId = updateId;
    }

    public LocalDateTime getCreateTime(){
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime){
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime(){
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime){
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o){
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        LindiTradeApplicationTemplateContractVO that = (
                LindiTradeApplicationTemplateContractVO) o;
        return Objects.equals(tradeApplicationContractFileId, that.tradeApplicationContractFileId)
                && Objects.equals(tradeApplicationId, that.tradeApplicationId)
                && Objects.equals(fileId, that.fileId) && Objects.equals(file, that.file)
                && Objects.equals(contractType, that.contractType)
                && Objects.equals(status, that.status)
                && Objects.equals(createId, that.createId)
                && Objects.equals(updateId, that.updateId)
                && Objects.equals(createTime, that.createTime)
                && Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode(){
        return Objects.hash(tradeApplicationContractFileId, tradeApplicationId, fileId, file, contractType, status, createId, updateId, createTime, updateTime);
    }

    @Override
    public String toString(){
        return "LindiTradeApplicationTemplateContractVO{" +
                "tradeApplicationContractFileId=" + tradeApplicationContractFileId +
                ", tradeApplicationId=" + tradeApplicationId +
                ", fileId=" + fileId +
                ", file=" + file +
                ", contractType='" + contractType + '\'' +
                ", status=" + status +
                ", createId=" + createId +
                ", updateId=" + updateId +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
